home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1999 / MacHack 1999.toast / The Hacks / DesktopDoubler / Nub / Display.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-06-26  |  1.4 KB  |  64 lines  |  [TEXT/CWIE]

  1. #ifndef _DISPLAY_
  2. #define _DISPLAY_
  3.  
  4. #include <Displays.h>
  5. #include <MacMemory.h>
  6. #include <MacTypes.h>
  7. #include <QuickDraw.h>
  8. #include "ProcInfo.h"
  9.  
  10.  
  11. typedef class SysWinHandler
  12. {
  13.     public:
  14.         virtual Boolean EventHandler(WindowPtr window,EventRecord *event,SInt16 part) = 0;
  15. } SysWinHandler;
  16.  
  17. typedef class Display : public SysWinHandler
  18. {
  19.     public:
  20.         Display        *next;
  21.         
  22.         void *operator new(size_t len)    { return (void*)NewPtrSysClear(len); }
  23.         void operator delete(void *data) { DisposePtr((Ptr)data); }
  24.         
  25.         Display(UInt32 index);
  26.         ~Display(void);
  27.         
  28.         OSStatus Create(GDHandle gdevToClone,DisplayIDType displayID,Boolean clone);
  29.         void Destroy(void);
  30.         void MoveTo(SInt16 x,SInt16 y);
  31.         
  32.         Boolean Contains(Point where);
  33.         Point GetOffset(void) { return *(Point*)&fGDev[0]->gdRect; }
  34.         DisplayIDType GetDisplayID(void) { return fDisplayID; }
  35.         void ShowHide(Boolean show);
  36.         
  37.     private:
  38.         UInt32            fIndex;
  39.         GDHandle        fGDev;
  40.         DisplayIDType    fDisplayID;
  41.         Boolean            fCloneDisplay;
  42.         WindowPtr        fCoverWindow;
  43.         WindowPtr        fMBarWindow;
  44.         
  45.         Boolean EventHandler(WindowPtr window,EventRecord *event,SInt16 part);
  46. } Display;
  47.  
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53.  
  54. WindowPtr NewSysWindow(Rect *bounds,StringPtr title,Boolean visible,SInt16 procID,WindowPtr behind,
  55.                         Boolean goAwayFlag,SysWinHandler *handler,RgnHandle rgn);
  56. OSErr DisposeSysWindow(WindowPtr window);
  57.  
  58.  
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62.  
  63. #endif /* _DISPLAY_ */
  64.